package org.marketlive.system.config;

/**
 * Returns the name of the given <code>IConfigurationNode</code>. Registers a class implementing
 * the <code>IConfigurationListener</code> interface that is interested in being notified when
 * configuration changes occur.
 */

/*
(C) Copyright MarketLive. 2006. All rights reserved.
MarketLive is a trademark of MarketLive, Inc.
Warning: This computer program is protected by copyright law and international treaties.
Unauthorized reproduction or distribution of this program, or any portion of it, may result
in severe civil and criminal penalties, and will be prosecuted to the maximum extent
possible under the law.
*/

public interface IConfigurationNode {

    /**
     * Returns the name of this node, which may be a branch or a leaf.
     * @return the name of the node
     */    
    String getName();

    /**
     * Registers a listener for changes to this configuration.
     *
     * @param listener the <code>IConfigurationListener</code> whose notify method to invoke when configuration
     * changes take place
     * @throws UnsupportedOperationException if underlying configuration store does not support notification
     */
    void listen(IConfigurationListener listener) throws UnsupportedOperationException;

}
